# -*- coding: utf-8 -*-
from urllib.parse import parse_qs
import json
import time
# 给定的查询字符串
# query_string = "big_organ_subacase_id=413&is_obtained=%E6%98%AF"

# 使用 parse_qs 将查询字符串解析为字典
# query_dict = parse_qs(query_string)
# parse_qs 返回的值是一个字典，其中键对应的值是一个列表
# 如果每个键只对应一个值，我们可以将列表转换为单个值
# query_dict_single_values = {k: v[0] for k, v in query_dict.items()}

# print(query_dict_single_values)

case_id = "123"
payload = {
"json": "{\"checkOrgans\":{\"2222\":true,\"11111\":true,\"肾脏\":true,\"肝脏\":true,\"心脏\":true,\"肺脏\":true,\"角膜\":true,\"胰腺\":true,\"小肠\":true,\"测试新增大器官\":true,\"测试逻辑删除大器官\":true},\"organsOptions\":[\"肾脏\",\"肝脏\",\"心脏\",\"肺脏\",\"角膜\",\"胰腺\",\"小肠\",\"2222\",\"测试新增大器官\",\"测试逻辑删除大器官\",\"11111\"],\"notGainReason\":{},\"liver\":{\"texture\":\"质软\",\"save\":\"冷保存\",\"pressure\":\"\",\"flow\":\"\",\"resistance\":\"\",\"estimate\":\"正常\",\"abnormal\":\"\",\"allocation\":\"西安交大一附院\",\"other\":\"\"},\"kidney1\":{\"texture\":\"硬\",\"textureDegree\":\"轻度\",\"save\":\"冷保存\",\"pressure\":\"\",\"flow\":\"\",\"resistance\":\"\",\"length\":\"111\",\"artery\":\"1\",\"vein\":\"1\",\"ureter\":\"单支\",\"estimate\":\"正常\",\"biopsy\":\"否\",\"biopsyResult\":\"\",\"abnormal\":\"\",\"allocation\":\"西安交大一附院\",\"other\":\"\"},\"kidney2\":{\"texture\":\"硬\",\"textureDegree\":\"轻度\",\"save\":\"冷保存\",\"pressure\":\"\",\"flow\":\"\",\"resistance\":\"\",\"length\":\"11\",\"artery\":\"1\",\"vein\":\"1\",\"ureter\":\"单支\",\"estimate\":\"正常\",\"biopsy\":\"否\",\"biopsyResult\":\"\",\"abnormal\":\"\",\"allocation\":\"西安交大一附院\",\"other\":\"\"},\"heart\":{\"save\":\"冷保存\",\"pressure\":\"\",\"flow\":\"\",\"resistance\":\"\",\"estimate\":\"正常\",\"abnormal\":\"\",\"biopsy\":\"否\",\"biopsyResult\":\"\",\"allocation\":\"西安交大一附院\",\"other\":\"\"},\"lung\":{\"save\":\"冷保存\",\"pressure\":\"\",\"flow\":\"\",\"resistance\":\"\",\"estimate\":\"正常\",\"abnormal\":\"\",\"biopsy\":\"否\",\"biopsyResult\":\"\",\"allocation\":\"西安交大一附院\",\"other\":\"\"}}",
}

# print(json.loads(payload['json']))
# base_info = {'anlibianhao': 'A-2024-170', 'xingming': '2024-11-24测试', 'nianling': '27', 'xingbie': '男', 'minzu': '汉族', 'zhengjian': '身份证号', 'shenfenzhenghao': '532224199704121234', 'juanxianyiyuan': '西安交通大学第一附属医院测试333', 'shengao': '170', 'tizhong': '70', 'BMI': '24.22', 'calculateBMI': '24.22', 'xueya': '100', 'xinlv': '90', 'tiwen': '37', 'huxi': '20'}
# print(json.dumps(base_info))

for k,v in payload.items():
	# print(k,v)
	if(type(v) == str):
		if(len(v)>=5):
			data_json = json.loads(v)
			print(f"\'{k}\':",data_json)
			print(',')
		else:
			print(f"\'{k}\':\'{v}\'",end="")
			print(',')
	else:
		print(f"\'{k}\':{v}",end="")
		print(',')

